using System;

namespace Wax
{
    /// <summary>
    /// The test progress event arguments
    /// </summary>
    public class TestProgressEventArgs : EventArgs
    {
        /// <summary>
        /// The total number of steps to complete
        /// </summary>
        private readonly int totalNumberOfSteps;

        /// <summary>
        /// The current step being completed
        /// </summary>
        private readonly int numberOfCompletedSteps;

        /// <summary>
        /// Initializes a new instance of the <see cref="TestProgressEventArgs"/> class.
        /// </summary>
        /// <param name="totalNumberOfSteps">The total number of steps.</param>
        /// <param name="numberOfCompletedSteps">The current step completed.</param>
        public TestProgressEventArgs(int totalNumberOfSteps, int numberOfCompletedSteps)
        {
            this.totalNumberOfSteps = totalNumberOfSteps;
            this.numberOfCompletedSteps = numberOfCompletedSteps;
        }

        /// <summary>
        /// The current step being completed
        /// </summary>
        public int NumberOfCompletedSteps
        {
            get { return numberOfCompletedSteps; }
        }

        /// <summary>
        /// The total number of steps to complete
        /// </summary>
        public int TotalNumberOfSteps
        {
            get { return totalNumberOfSteps; }
        }

        /// <summary>
        /// Gets the percent complete.
        /// </summary>
        /// <value>The percent complete.</value>
        public int PercentComplete
        {
            get
            {
                return (int) ((this.numberOfCompletedSteps / (float) this.totalNumberOfSteps) * 100);
            }
        }
    }
}